% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distance_by_groups_by_site-DRAFT.R
\name{distance_by_group_by_site}
\alias{distance_by_group_by_site}
\title{Ratios at each site, of avg dist of group / avg dist of everyone else near site}
\usage{
distance_by_group_by_site(bybg)
}
\arguments{
\item{bybg}{such as \code{\link[=ejamit]{ejamit()}}$results_bybg_people}
}
\value{
table of ratios, one col per site, one row per indicator
}
\description{
Like \code{\link[=distance_by_group]{distance_by_group()}} but for multiple sites - DRAFT FUNCTION
}
\details{
There are two aspects of proximity to consider when analyzing
demographic groups within a certain fixed distance (radius) from a single
facility point (or a whole set of facilities). These two ways of summarizing
proximity are complementary:
\enumerate{
\item Which groups tend to live nearby in the sense of being within the selected radius
versus outside the radius? In other words, which groups are "overrepresented"
within X miles of the site? This treats proximity as a yes/no, binomial
question -- a resident is nearby or not. It would focus on whether someone is
anywhere within 3 miles, say, and ignore the differences between
being 1, 2, or 3 miles away.
\item Among the residents within X miles of the site, which groups live especially close to the
facility? This question recognizes proximity is a continuous variable, and
focuses on the difference between 1 mile, 1.5 miles, etc. However, it only
looks at residents within the X miles radius area analyzed, so it fails
to recognize that some groups tend to live more than 3 miles away, for example.
This perspective does not take into account which groups are overrepresented
within the original total radius near a site.
}

This function does the second of these two types of analysis. It reports,
only among those anywhere inside the radius, which groups are closer to the site.

In a specific location, for example, one demographic group could be
underrepresented within 3 miles, but those few who are in the group
still might live right next to the facility in which case
their average distance would be higher than that of any other group
because this function only counts those within the radius analyzed.

In some other location, the opposite could occur -- if one group is
overrepresented within 3 miles, they still might all live in a community
about 2.9 miles away from the site -- that would mean their distance from
the site on average is greater (or their proximity score is lower)
than other groups within 3 miles of the site.
}
\examples{
  # distance_by_group_by_site(
  #   testoutput_ejamit_10pts_1miles$results_bybg_people
  # )

}
\seealso{
\code{\link[=ejamit_compare_distances]{ejamit_compare_distances()}} \code{\link[=distance_by_group_plot]{distance_by_group_plot()}} \code{\link[=plot_distance_mean_by_group]{plot_distance_mean_by_group()}} \code{\link[=distance_by_group]{distance_by_group()}} \code{\link[=distance_mean_by_group]{distance_mean_by_group()}}
}
